<?php

######################
include ("head.php");#
######################

	if ($uid == $_SESSION['uid'])
	{
		if (@$_POST['action'] == "modif_profil")
		{
			$get_result = user_modif_mysql(@$_POST['mail'], @$_POST['user']);
			if ($get_result == -1)
			{
				$msg = "Le profil n'a pas &eacute;t&eacute; modifie!";
				alert($msg);
				redirect("profil.php", 2000);
				Print("<br><br>");
			}
			$get_result = template_modif(@$_POST['tmp']);
			if ($get_result == 0)
				redirect("profil.php", 1);
		}
		elseif (@$_POST['action'] == "modif_pass")
		{
			$get_result = pass_modif_mysql(@$_POST['passold'], @$_POST['pass1'], @$_POST['pass2']);
			if ($get_result == -1)
			{
				$msg = "Le mot de passe n'a pas &eacute;t&eacute; modifi&eacute;!";
				alert($msg);
				redirect("profil.php", 2000);
				Print("<br><br>");
			}
		}
		elseif (@$_POST['action'] == "modif_infos")
		{
		  	$get_result = infos_modif(@$_POST);
		  	if ($get_result == -1)
		  	{
				$msg = "Les informations n'on pas pu &eacute;t&eacute; modifi&eacute;es!";
				alert($msg);
				redirect("profil.php", 2000);
				Print("<br><br>");
		  	}
		  	if ($get_result == 0)
		  		redirect("profil.php", 1);
		}
	}
			
	Print("
		<table width=100%>
			<tr>
				<td width=53% valign=top>
					<div id=\"box\" style=\"height: 300px; border: 0;\">
						<h3>Activit&eacute;s de $infos[first]</h3>
						<hr style=\"border: 0; border-top: 1px lightgray solid;\"><br>");
							if (@$_GET['sta'] == "")
								$sta = 0;
							else
								$sta = $_GET['sta'];
							show_user_feed($uid, $sta, $maxa);
							$req = "SELECT hid FROM history_users WHERE uid=$uid";
					Print("</div>");
						show_page_search($sta, $maxa, $req, "profil.php?id=$uid&sta");
	Print("
				</td>
			</tr>
		</table>

	<!-- <br><hr style=\"border: 0; border-top: 1px lightgray solid;\"><br> -->
	
	");

?>